document.addEventListener("DOMContentLoaded", function() {

    let now = new Date();

    let hour = now.getHours();


    let greeting;
    if (hour >= 6 && hour < 12) {
        greeting = "早上好~";
    } else if (hour >= 12 && hour < 18) {
        greeting = "下午好~";
    } else {
        greeting = "晚上好~";
    }

    let time = document.querySelector('.user .time');
        time.textContent = greeting;
});